Skip to content

Conversation

evan-goode
Copy link
Contributor

"Mojang auth" (now ironically named) is still in use today by custom authentication servers. We are grateful for node-minecraft-protocol's continued support for it! Some of these custom authentication servers [0][1] support player certificates just like Mojang's API servers do, at the $servicesServer/player/certificates endpoint (when using Mojang's servers, $servicesServer = https://api.minecraftservices.com). The process for fetching player certificates is no different when using a Microsoft account or a Mojang/other account. It works like any other Mojang API route that requires an accessToken. But in node-minecraft-protocol, Microsoft authentication, including certificate fetching, is done in prismarine-auth and certificate fetching isn't implemented for third-party accounts.

This PR copies the certificate fetching logic from prismarine-auth to mojangAuth.js in node-minecraft-protocol to make certificate fetching work with third-party accounts. Certificate fetching can be disabled by setting disableChatSigning: true just like with Microsoft accounts. If certificates fetching fails, a warning is printed and login continues.

An alternative approach to copying would be to export fetchCertificates from prismarine-auth and somehow make it possible to override the servicesServer there. But IMHO the cleaner option is to duplicate the code in node-minecraft-protocol, it's only ~20 lines.

[0] https://github.com/unmojang/drasl
[1] https://ely.by/

Borrows the fetchCertificates implementation from prismarine-auth
@evan-goode evan-goode force-pushed the evan-goode/custom-auth branch from 9b32bb0 to 2080118 Compare July 28, 2025 20:10
@evan-goode
Copy link
Contributor Author

Thanks for the approval. The CI failure seems to be transient and unrelated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants